function PopQueue()
{
    this.count = 0;
    this.lowestCount = 0;
    this.items = {};
        if ($('body #dequeue_next').length == 0)
            $('body').append('<div id="dequeue_next"></div>')
    }
    PopQueue.prototype.enqueue = function(element)
    {
        if (!$.isFunction(element))
        {
            return undefined
        }
        this.items[this.count] = element;
        this.count++
    };
    PopQueue.prototype.dequeue = function()
    {
        if (this.count > 0)
        {
            const result = this.items[this.lowestCount];
            delete this.items[this.lowestCount];
            this.lowestCount++;
            if ($.isFunction(result))
            {
                result();
                if (this.lowestCount < this.count)
                {
                    let _this = this;
                    $('#dequeue_next').on('click', '', function()
                    {
                        setTimeout(() => 
                            {
                                _this.dequeue()
                            }, 300)
                    })
                }
            }
        }
    };
